package chap6;

public class ExceptionDemo3 {
	static void demomethod(){
		try{
			throw new NullPointerException("demo3");
		}
		catch(NullPointerException e){
			System.out.println("caught inside method");
			throw e;
		}
	}	
	public static void main(String args[]){
		try{
			demomethod();
		}
		catch(NullPointerException e){
			System.out.println("caught in main: "+e);
		}
	}
}
